# -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
    File Name:  string_opr
    Author   :  wanwei1029
    Date     :  2018/10/9
    Desc     : string类型的常见操作
------------------------------------------------------------------------------
"""

import samp.samp_logging as sl

logger = sl.get_logger("string_opr")


def split_demo():
    """"
    python 中,split | 不用特殊处理。
    """
    a = "a|bc|def"
    b = a.split("|")
    for c in b:
        print(c)


def connect():
    """
    常用的连接方式有：+，%s,%d, join三种
    :return:
    """
    a = "abce/"
    b = "efgh"
    logger.info("str + str connect : {0}".format((a+b)))
    c = b'5'
    logger.info("str + int connect : {0}".format((a + str(c))))


if __name__ == '__main__':
    test_method = "split_demo"
    if test_method == "connect":
        connect()
    elif test_method == "split_demo":
        split_demo()
    print("done, ok")
